/**
 * 
 */
package com.workable.assignment.services.ws.factories;

import java.util.Collection;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;

import com.workable.assignment.domain.Movie;
import com.workable.assignment.services.ws.responses.MovieRamaResponse;

/**
 * The class MovieRamaResponseFactory implements response factory mechanism
 * 
 * @author npapadopoulos
 * 
 */
public class MovieRamaResponseFactory {

    public static Response createResponse(Collection<Movie> movies, String status, String description) {

        // initialize and set the status
        ResponseBuilder responseBuilder = Response.ok();

        // set the body
        MovieRamaResponse body = new MovieRamaResponse();
        body.setMovies(movies);
        body.setStatusCode(status);
        body.setDescription(description);

        responseBuilder.entity(body);

        return responseBuilder.build();
    }
}
